package com.xm.settlement.service.impl;

import com.baomidou.framework.service.impl.SuperServiceImpl;
import com.baomidou.mybatisplus.plugins.Page;
import com.xm.settlement.commons.utils.PageInfo;
import com.xm.settlement.mapper.NewsManageMapper;
import com.xm.settlement.model.NewsManage;
import com.xm.settlement.service.INewsManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 *  NewsManageMapper 表数据服务层接口实现类
 *
 */
@Service
public class NewsManageServiceImpl extends SuperServiceImpl<NewsManageMapper, NewsManage> implements INewsManageService {

    @Autowired
    private NewsManageMapper newsManageMapper;


    @Override
    public void selectDataGrid(PageInfo pageInfo) {
        Page<NewsManage> page = new Page<NewsManage>(pageInfo.getNowpage(), pageInfo.getSize());
        Long createId =  Long.valueOf(String.valueOf(pageInfo.getCondition().get("createId")));
        List<NewsManage> list = newsManageMapper.selectNewsManageList(page,createId);
        pageInfo.setRows(list);
        pageInfo.setTotal(page.getTotal());
    }

    @Override
    public void selectDataGrid1(PageInfo pageInfo) {
        Page<NewsManage> page = new Page<NewsManage>(pageInfo.getNowpage(), pageInfo.getSize());
        List<NewsManage> list = newsManageMapper.selectNewsManageList1(page);
        pageInfo.setRows(list);
        pageInfo.setTotal(page.getTotal());
    }

}